//
//  DSSHMeRepairsVC.m
//  DSSH
//
//  Created by lcy on 16/3/30.
//  Copyright © 2016年 lcy. All rights reserved.
//

#import "DSSHMeRepairsVC.h"
#import "MeRepairsCell.h"
#import "DSSHMeRepairsDetailVC.h"
#import "UIView+Round.h"
@interface DSSHMeRepairsVC ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,weak)IBOutlet UITableView* repairsTableView;
@end

@implementation DSSHMeRepairsVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"我的报修";
    UIBarButtonItem * backBarBtn = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"fanhui"] style:UIBarButtonItemStylePlain target:self action:@selector(backBarBtnClick)];
    self.navigationItem.leftBarButtonItem = backBarBtn;
    self.repairsTableView.delegate  = self;
    self.repairsTableView.dataSource = self;
    self.repairsTableView.tableFooterView = [[UIView alloc]init];
    self.view.backgroundColor = [UIColor whiteColor];
    // Do any additional setup after loading the view from its nib.
}
-(void)backBarBtnClick
{
    [self.navigationController popViewControllerAnimated:YES];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 3;
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString * cellID = @"cellID";
    MeRepairsCell * cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (!cell)
    {
        cell = [[NSBundle mainBundle]loadNibNamed:@"MeRepairsCell" owner:nil options:nil][0];
    }
    [cell.bgView getRoundView:5];
    cell.bgView.layer.borderWidth = 1;
    cell.bgView.layer.borderColor = [[UIColor grayColor]CGColor];
    cell.placeLabel.text = @"未来之光4栋1单元1号楼梯K1";
    cell.timeLabel.text = @"2016.01.01";
    cell.detailsLabel.text = @"完成上画任务，按要求拍摄照片，请及时上传照片。";
    return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 122;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    DSSHMeRepairsDetailVC * detailVC = [[DSSHMeRepairsDetailVC alloc]init];
    [self.navigationController pushViewController:detailVC animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
